import {Login_values} from "../utils/index"
import {Dispatch} from "redux"
import axios from "axios"

export let login_info = (values:Login_values) => {
    return async (dispatch:Dispatch) => {
        let {data} = await axios.get("/api/login",{params:values})
        dispatch({
            type:"LOGIN_INFO",
            payload:data
        })
    }
}

export let register_info = (values:Login_values) => {
    return async (dispatch:Dispatch) => {
        let {data} = await axios.get("/api/register",{params:values})
        dispatch({
            type:"REGISTER_INFO",
            payload:data
        })
    }
}